testsuite: Fix some memory leaks reported by asan
authorMatthias Clasen <mclasen@redhat.com>
Wed, 8 Jul 2020 19:05:16 +0000 (15:05 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 8 Jul 2020 19:09:13 +0000 (15:09 -0400)
testsuite/gdk/memorytexture.c

index 3f941cdb293310492f23032739f0efe1d5e8d52c..5f61b8c079a0878bee9c33fc2517a6cdbb88b523 100644 (file)
@@ -102,7 +102,7 @@ create_texture (GdkMemoryFormat  format,
                 tests[format].bytes_per_pixel);
       }
 
-  bytes = g_bytes_new_static (data, height * MAX (stride, tests[format].bytes_per_pixel));
+  bytes = g_bytes_new_take (data, height * MAX (stride, tests[format].bytes_per_pixel));
   texture = gdk_memory_texture_new (width, height,
                                     format,
                                     bytes,